package com.lu.stack.api;

import cn.hutool.extra.spring.EnableSpringUtil;
import com.lu.component.http.proxy.config.RpcApplicationContext;
import com.lu.component.rpc.RpcProxyManager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author zhanglu
 * @project lu-cloud-stack
 * @description
 * @date 2023/2/1 23:36
 */
@com.lu.component.rpc.annotations.EnableRpcClients(basePackages = "com.lu.stack.proxy.rpc.test")
@com.lu.component.rpc.boot.core.annotations.EnableRpcClients(basePackages = "com.lu.stack.proxy.rpc.test")
@EnableSpringUtil
@EnableFeignClients(basePackages = {"com.lu.stack"})
@EnableDiscoveryClient
@ComponentScan(basePackages = {"com.lu.stack"})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class LuStackApiApplication {

    public static void main(String[] args) {
        //开启rpc-http请求代理自动配置
        RpcProxyManager.run();
        //配置参数-rpc-http请求代理
        RpcApplicationContext.RPC_CLIENT_PROPERTIES.setTimeout(10000L);
        SpringApplication.run(LuStackApiApplication.class, args);
    }

}
